<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Demo</title>
		<!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
		<link href="//unpkg.com/layui@2.9.21-rc/dist/css/layui.css" rel="stylesheet">
	</head>
	<body>
		<!-- 给容器追加 class="layui-form-pane"，即可显示为方框风格 -->
		<form class="layui-form layui-form-pane" action="" lay-filter="updateForm">
			<div class="layui-form-item">
				<!--1.数据回显
				2.隐藏主键值在页面上
				-->
			<input type="hidden" name="scId"/>

			<div class="layui-form-item">
				<label class="layui-form-label">客户经理</label>
				<div class="layui-input-inline">
					<select name="scGiveuser" lay-filter="aihao">
						<option value="杜经理">杜经理</option>
						<option value="李经理" selected>李经理</option>
					</select>
				</div>
			</div>
			
			<div class="layui-form-item">
				<button class="layui-btn" lay-submit lay-filter="demo2">确认</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</form>

		<!-- 请勿在项目正式环境中引用该 layui.js 地址 -->
		<script src="../layui/layui.js"></script>
		<script>
			layui.use(['form'], function() {
				var form = layui.form;
				var layer = layui.layer;
				// 提交事件
				form.on('submit(demo2)', function(data) {
					var field = data.field; // 获取表单字段值
					// 显示填写结果，仅作演示用
					layer.alert(JSON.stringify(field), {
						title: '当前填写的字段值'
					});
					// 此处可执行 Ajax 等操作
					// …
					return false; // 阻止默认 form 跳转
				});
			});
		</script>

	</body>
</html>